/*
    main.me -- MakeMe file for ESP
 */

Me.load({
    makeme: '>=0.9.0',

    plugins: [ 'installs' ],

    blend: [
        'src/*.me',
        'src/*/*.me',
        'samples/samples.me',
        'test/test.me',
        'doc/doc.me',
    ],

    configure: {
        requires:  [ 'compiler', 'osdep', 'http', 'mpr', 'pcre' ],
        discovers: [ 'mdb', 'sqlite', 'ssl' ],
    },

    customize: [
        /* 
            The optional custom.me file is loaded after main.me is fully processed. It can
            thus override any setting. Feel free to create and customize. 
         */
        'custom.me',
    ],

    settings: {
        integrate: true,

        /*
            Installation prefix set
         */
        prefixes: 'install-prefixes',
        manifest: 'installs/manifest.me',

        platforms: [ 'local' ],
        tune: 'size',

        http: {
            /* Use PAM (Plugable Authentication Module) to store passwords */
            pam: true,
            webSockets: true,
        },

        mpr: {
            /*
                Enable logging via mprLog to the log file
                The default is to enable logging for both debug and release builds.
             */
            logging: true,
        },

        watchdog: {
            name: 'espman',
        },

        tune: 'speed',
    },

    scripts: {
        loaded: `
            if (me.targets.httpcmd) {
                me.targets.httpcmd.enable = false
            }
        `,
    },

    targets: {
        init: {
            first: true,
            path: 'init',
            'generate-make': `
                if [ ! -d /usr/include/openssl ] ; then echo
                    echo Install libssl-dev to get /usr/include/openssl
                    exit 255
                fi
            `,
            action: ' ',
            enable: "me.platform.os == 'linux'",
        },
        mdb: {
            configurable: true,
            description: 'Embedthis MDB Database',
        },

        projects: {
            action: `genProjects('', 'default')`,
        },

        mine: {
            action: `genProjects('', 'mine', Config.OS + '-' + Config.CPU)`,
        }
    },

    usage: {
        // 'mpr.logging':  'Enable application logging (true|false)',
    },
})
